<!-- 其他相关了解的事项 -->
<template>
	<view class="other1">
		<top-page :majorList="majorList" :querySign="choose"></top-page>

		<!-- <tai-tou titleColor="#FFFFFF" title="其他需要了解的事项"></tai-tou> -->

		<view class="column_center font18 bold">
			<text class="font16 bold">其他需要了解的事项</text>
			<view class="tips">研究方向、学科概况、学科培养方向；初试特殊要求、参考书；笔试、面试；导师、奖学金....</view>
		</view>

		<view class="content-item content-item-first">
			<view class="titles"> <img
					src="https://image.alhelp.net/uploads/20231104/340b7c248a2fff875289157d194f1c29.png"></img> 研究方向和考试科目</view>
			<view class="content_box">
				<view class="diretionontainer">
					<view class="diretionBox" v-if="diretion.directionsN && diretion.directionsN.length !== 0">
						<view class="diretionBox-item" v-for="(item, index) in diretion.directionsN" :key="index">
							<view class="head">
								<view class="year">{{ diretion.directionsN[0].coreStudyDirectionEntityList[0].majorYear }}年</view>
								<view class="title">{{ item.coreStudyDirectionEntityList[0].name }}</view>
							</view>
							<view class="diretionBox-item-cont" v-for="(t, i) in diretion.directionsN[0].tbaseExamSubjectList"
								:key="i">
								<view class="project">
									<view class="subTitle">科目一</view>
									<view class="type">{{ t.code1 }} </view>
									<view class="type linght" v-if="t.book1">[参考资料{{t.book1}}]</view>
								</view>
								<view class="project">
									<view class="subTitle">科目二</view>
									<view class="type">{{ t.code2 }}</view>
									<view class="type linght" v-if="t.book2">[参考资料{{t.book2}}]</view>
								</view>
								<view class="project">
									<view class="subTitle">科目三</view>
									<view class="type">{{ t.code3 }} </view>
									<view class="type linght" v-if="t.book3">[参考资料{{t.book3}}]</view>
								</view>
								<view class="project">
									<view class="subTitle">科目四</view>
									<view class="type">{{ t.code4 }} </view>
									<view class="type linght" v-if="t.book4">[参考资料{{t.book4}}]</view>
								</view>
							</view>

						</view>
					</view>

					<view class="diretionBox" v-if="diretion.directionsN1 && diretion.directionsN1.length !== 0">
						<view class="diretionBox-item" v-for="(item, index) in diretion.directionsN1" :key="index">
							<view class="head">
								<view class="year">{{ diretion.directionsN1[0].coreStudyDirectionEntityList[0].majorYear }}年</view>
								<view class="title">{{ item.coreStudyDirectionEntityList[0].name }}</view>
							</view>
							<view class="diretionBox-item-cont" v-for="(t, i) in diretion.directionsN1[0].tbaseExamSubjectList"
								:key="i">
								<view class="project">
									<view class="subTitle">科目一</view>
									<view class="type">{{ t.code1 }} </view>
									<view class="type linght" v-if="t.book1">[参考资料{{t.book1}}]</view>
								</view>
								<view class="project">
									<view class="subTitle">科目二</view>
									<view class="type">{{ t.code2 }} </view>
									<view class="type linght" v-if="t.book2">[参考资料{{t.book2}}]</view>
								</view>
								<view class="project">
									<view class="subTitle">科目三</view>
									<view class="type">{{ t.code3 }}</view>
									<view class="type linght" v-if="t.book3">[参考资料{{t.book3}}]</view>
								</view>
								<view class="project">
									<view class="subTitle">科目四</view>
									<view class="type">{{ t.code4 }} </view>
									<view class="type linght" v-if="t.book4">[参考资料{{t.book4}}]</view>
								</view>
							</view>

						</view>
					</view>

					<view class="diretionBox" v-if="diretion.directionsN2 && diretion.directionsN2.length !== 0">
						<view class="diretionBox-item" v-for="(item, index) in diretion.directionsN2" :key="index">
							<view class="head">
								<view class="year">{{ diretion.directionsN2[0].coreStudyDirectionEntityList[0].majorYear }}年</view>
								<view class="title">{{ item.coreStudyDirectionEntityList[0].name }}</view>
							</view>
							<view class="diretionBox-item-cont" v-for="(t, i) in diretion.directionsN2[0].tbaseExamSubjectList"
								:key="i">
								<view class="project">
									<view class="subTitle">科目一</view>
									<view class="type">{{ t.code1 }}</view>
									<view class="type linght" v-if="t.book1">[参考资料{{t.book1}}]</view>
								</view>
								<view class="project">
									<view class="subTitle">科目二</view>
									<view class="type">{{ t.code2 }} </view>
									<view class="type linght" v-if="t.book2">[参考资料{{t.book2}}]</view>
								</view>
								<view class="project">
									<view class="subTitle">科目三</view>
									<view class="type">{{ t.code3 }} </view>
									<view class="type linght" v-if="t.book3">[参考资料{{t.book3}}]</view>
								</view>
								<view class="project">
									<view class="subTitle">科目四</view>
									<view class="type">{{ t.code4 }}</view>
									<view class="type linght" v-if="t.book4">[参考资料{{t.book4}}]</view>
								</view>
							</view>

						</view>
					</view>
				</view>
			</view>
		</view>

		<view class="content-item">
			<view class="titles"> <img
					src="https://image.alhelp.net/uploads/20231104/340b7c248a2fff875289157d194f1c29.png"></img> 学科概述</view>
			<view class="content_box">
				<text class="content-box-txt" v-if="majorList.description"> {{ majorList.description }} </text>
				<text v-else class="content-box-txt-null">暂无数据</text>
			</view>
		</view>

		<view class="content-item">
			<view class="titles"> <img
					src="https://image.alhelp.net/uploads/20231104/340b7c248a2fff875289157d194f1c29.png"></img> 专业培养方向</view>
			<view class="content_box">
				<text class="content-box-txt" v-if="school_data.baseReporting">
					{{ school_data.baseReporting.trainingObjective }}
				</text>
				<text v-else class="content-box-txt-null">暂无数据</text>
			</view>
		</view>

		<view class="content-item">
			<view class="titles"> <img
					src="https://image.alhelp.net/uploads/20231104/340b7c248a2fff875289157d194f1c29.png"></img>
				学制</view>
			<view class="content_box">
				<view class="content-box-list" v-if="priceInfo.educationalSystem">
					<view class="content-box-teachers">
						{{priceInfo.educationalSystem}}
					</view>
				</view>
				<text v-else class="content-box-txt-null">暂无数据</text>
			</view>
		</view>

		<view class="content-item">
			<view class="titles"> <img
					src="https://aihelp.oss-cn-hangzhou.aliyuncs.com/public/base/2023/11/07/da23bed391884e9f91e1b99b8151dd02.png"></img>
				学费</view>
			<view class="content_box">
				<view class="content-box-list" v-if="priceInfo.tuition">
					<view class="content-box-teachers">
						{{priceInfo.tuition}}
					</view>
				</view>
				<text v-else class="content-box-txt-null">暂无数据</text>
			</view>
		</view>

		<view class="content-item">
			<view class="titles"> <img
					src="https://aihelp.oss-cn-hangzhou.aliyuncs.com/public/base/2023/11/07/da23bed391884e9f91e1b99b8151dd02.png"></img>
				奖学金</view>
			<view class="content_box">
				<view class="content-box-list" v-if="priceInfo.scholarship">
					<view class="content-box-teachers">
						{{priceInfo.scholarship}}
					</view>
				</view>
				<text v-else class="content-box-txt-null">暂无数据</text>
			</view>
		</view>

		<view class="content-item">
			<view class="titles"> <img
					src="https://image.alhelp.net/uploads/20231104/daa7594fe0a18d325766f22526b37021.png"></img> 导师</view>
			<view class="content_box">
				<view class="content-box-list" v-if="teacherList.length > 0">
					<view class="content-box-teachers" v-for="(item, index) in teacherList" :key="index">
						<text>{{ item.userName }}</text>
					</view>
				</view>
				<text v-else class="content-box-txt-null">暂无数据</text>
			</view>
		</view>

		<!-- <u-divider text="博士生导师"></u-divider>
		<view v-for="(item,index) in school_data.baseReportingTeacherList" class="row_between_top"
			style="width: 686rpx;margin: 32rpx;">
			<image :src="item.userLogo" class="avatar" mode="aspectFill"></image>
			<view class="">
				<view :class="['supor_intro_box',item.show_all_intro?'':'show_2_line']">
					<text class="bold">{{item.userName}}</text><br />
					<text class="fs14 semi">{{item.introduce}}</text>
				</view>
				<view class="row_center" @click="switch_show_intro(index,'doc')" style="padding: 12rpx;">
					<u-icon :name="item.show_all_intro?'arrow-up':'arrow-down'" color="#19CCA5"></u-icon>
				</view>
			</view>
		</view> -->

		<!-- <u-divider text="硕士生导师"></u-divider> -->
		<!-- 		<view class="column_center" style="padding: 32rpx 0 20rpx 0;background-color: #F7F8F9;"><text class="fs17 bold">奖学金</text></view>
		<view class="column_center" style="margin: 40rpx;">
			<text class="fs11 gray">没有更多了</text>
		</view> -->
	</view>
</template>

<script>
	import {
		getOther,
		querySchoolDtail,
		getTeacherList,
		otherMatters,
		getSchoolPriceInfo
	} from '@/api/toolbox.js'
	// import buoy from '@/components/buoy/buoys.vue';
	import topPage from "./top-page.vue"
	export default {
		components: {
			topPage
			// buoy
		},
		data() {
			return {
				priceInfo:{},
				iStatusBarHeight: 0,
				majorList: {}, //该专业信息
				major_data: {},
				school_data: {},
				diretion: {}, //研究方向
				schoolDetail: {}, //学校数据
				teacherList: [], //教师详情
				choose: {},
			}
		},
		onLoad(options) {
			this.choose = {
				...options
			}
			this.majorList = JSON.parse(options.majorList);
			//是否查看demo
			if (options.isDemo == 1) {
				this.choose.majorCode = '045115';
				this.choose.collegeCode = '005';
				this.choose.schoolCode = '10691';
			}
			this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight + 10;
			this.otherMatters()
			this.getOther()
			this.getSchoolDetail()
			this.getTeacherList()
			this.getSchoolProceInfos();
		},
		methods: {
			getSchoolProceInfos() {
				getSchoolPriceInfo({
					'collegeCode': this.choose.collegeCode,
					'majorCode': this.choose.majorCode,
					'schoolCode': this.choose.schoolCode,
				}).then(res => {
					if (res.code == 100000) {
						this.priceInfo = res.data;
					}
				})
			},
			goback() {
				uni.navigateBack({
					delta: 1
				})
			},

			getOther() {
				getOther({
					'collegeCode': this.choose.collegeCode,
					'majorCode': this.choose.majorCode,
					'schoolCode': this.choose.schoolCode,
				}).then(res => {
					console.log('数据是', res);
					this.diretion = res.data
				})
			},
			getSchoolDetail() {
				querySchoolDtail({
					'code': this.choose.schoolCode,
				}).then(res => {
					console.log('学校详情', res);
					this.schoolDetail = res.data
				})
			},
			getTeacherList() {
				getTeacherList({
					'collegeCode': this.choose.collegeCode,
					'majorCode': this.choose.majorCode,
					'schoolCode': this.choose.schoolCode,
					'year': new Date().getFullYear(),
					// 'year': this.$store.state.systemInfo.storage.year,
					'pageNum': 1,
					'pageSize': 10,

				}).then(res => {
					console.log('老师详情', res);
					this.teacherList = res.data.rows
				})

			},
			otherMatters() {
				otherMatters({
					'collegeCode': this.choose.collegeCode,
					'majorCode': this.choose.majorCode,
					'year': new Date().getFullYear(),
					// "year": this.$store.state.systemInfo.storage.year
				}).then(res => {
					console.log(888888, res)
					this.school_data = res.data
				})
			},
			//切换导师信息的隐藏和展示，type: doc | mas
			switch_show_intro(index, type) {
				if (this.major_data[type + '_super'][index]['show_all_intro']) {
					this.major_data[type + '_super'][index]['show_all_intro'] = false
				} else {
					this.major_data[type + '_super'][index]['show_all_intro'] = true
				}

			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: $pageBgColor;
	}
</style>
<style scoped lang="scss">
	.other1 {
		// background: #f2f2f2;
		padding-bottom: 20rpx;
	}

	.content_box {
		margin: 0 28rpx;
		// line-height: 1.75;
		// text-indent: 32px;
		text-align: justify;



		.content-box-list {
			display: flex;
			align-items: center;
			justify-content: flex-start;
			flex-wrap: wrap;
		}
	}

	.content-box-teachers {
		margin-right: 20rpx;
		font-size: 14px;
		color: #555555;
		font-weight: 400;
		font-style: normal;
		letter-spacing: normal;
		line-height: 1rem;
		margin-bottom: 30rpx;
	}

	.content-box-txt {
		color: #555555;
		line-height: 20px;
		font-weight: 400;
		font-style: normal;
		font-size: 13px;
		letter-spacing: normal;
	}

	.content-box-txt-null {
		color: #555555;
		line-height: 20px;
		font-weight: 400;
		font-style: normal;
		font-size: 13px;
		letter-spacing: normal;
		display: flex;
		align-items: center;
		justify-content: center
	}

	.avatar {
		width: 120rpx;
		height: 120rpx;
		border-radius: 50px;
		margin-right: 16rpx;
	}

	.supor_intro_box {
		line-height: 1.5;
		width: 550rpx;
		text-align: justify;
	}

	.show_2_line {
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 3;
	}

	.diretionontainer {
		width: 100%;
	}

	.diretionBox {
		position: relative;
		font-size: 15px;
		margin-bottom: 30rpx;

	}

	.diretionBox-item {
		margin-bottom: 48rpx;
		background: #f2f2f24d;
	}

	.head {
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		height: 108rpx;
		border-bottom: 1px solid #eee;
		border: 2rpx dashed #b4bbc580;

		.year {
			display: flex;
			justify-content: start;
			position: absolute;
			top: -20rpx;
			left: -20rpx;
			// width: 200rpx;
			height: 56rpx;
			line-height: 56rpx;
			text-align: center;
			padding: 0 20rpx;
			color: #fff;
			background: #46d5b6;
			border-top-right-radius: 32rpx;
			border-bottom-left-radius: 32rpx;
		}
	}

	.diretionBox-item-cont {
		margin-top: 2px;
		padding-bottom: 20rpx;
		border: 2rpx dashed rgba(180, 187, 197, 0.5);
	}

	.subTitle {
		/* font-weight: 700; */
		font-size: 28rpx;
		font-weight: bolder;
	}

	.type {
		/* font-weight: 700; */
		font-size: 24rpx;
	}

	.project {
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		// width: 648rpx;
		margin-bottom: 20rpx;
	}

	.leftBox {
		width: 35%;
		margin-right: 5px;
		padding-top: 75px;
		padding-left: 10px;
		background-color: #e7e9f4;
		overflow: auto;
		font-size: 26rpx;
	}

	.rightBox {
		overflow: auto;
		padding: 20px;
		width: 65%;
		background-color: #e7e9f4;
		font-size: 26rpx;
	}

	.div1 {
		width: 100px;
		left: -23px;
		top: 35px;
		height: 0;
		position: absolute;
		border-bottom: 20px solid #5c6eb7;
		border-left: 15px solid transparent;
		border-right: 15px solid transparent;
		transform: rotate(-39deg);
	}

	.yearBox {
		color: #fff;
		// text-align: center;
		font-size: 13px;
		padding-left: 20px;
	}

	.column_center {
		padding: 32rpx 0 20rpx 0;
		text-align: center;

		.tips {
			color: #555555;
			font-weight: 400;
			font-style: normal;
			font-size: 13px;
			line-height: 1rem;
			margin: 16rpx 80rpx 0;
		}
	}

	.content-item {
		margin: 0 30rpx 60rpx;
		background: #ffffff;
		padding-bottom: 60rpx;

		.titles {
			font-weight: 700;
			font-style: normal;
			font-size: 14px;
			color: #333333;
			display: flex;
			align-items: center;
			justify-content: center;
			// height: 108rpx;
			// line-height: 108rpx;
			line-height: 1rem;
			padding-top: 48rpx;
			padding-bottom: 32rpx;

			img {
				width: 32rpx;
				height: 32rpx;
				margin-right: 20rpx
			}
		}
	}

	.content-item-first {
		padding-bottom: 20rpx;
	}

	.linght {
		color: #969696;
	}

	.title {
		color: #ff9800;
	}
</style>